package com.gbas.muspulp;

import pulpcore.animation.Easing;
import pulpcore.animation.Timeline;
import pulpcore.image.CoreImage;
import pulpcore.scene.Scene2D;
import pulpcore.sprite.ImageSprite;

/**
 * User: t50
 * Date: 07-abr-2010
 * Time: 10:07:13
 */
public class AnimatedSpriteNaipe {
    CoreImage image;
    //    CoreImage[] images = new CoreImage[10];
    Timeline timeline = new Timeline(Easing.BACK_OUT);
    final double angle = (Math.PI * 2) / 10;

    public AnimatedSpriteNaipe(final CoreImage im1) {
        image = im1;
    }

    public void launch(Scene2D scene, int x, int y, int destx, int desty) {
        if (timeline.isPlaying()) {
            ImageSprite sp = new ImageSprite(image, x, y);
            timeline.at(500).move(sp, x, y, destx, desty, 4000);
            scene.add(sp);
        } else {
            ImageSprite sp = new ImageSprite(image, x, y);
            timeline.move(sp, x, y, destx, desty, 4000);
            scene.addTimeline(timeline);
            scene.add(sp);
        }
    }
}
